<template>
  <!-- 顶部通栏 -->
  <AppNavbar></AppNavbar>

  <!-- 头部组件 -->
  <AppHeader></AppHeader>

  <!-- 吸顶头部 -->
  <AppHeaderSticky></AppHeaderSticky>

  <!-- 内容容器 -->
  <div class="main">
    <!-- 二级路由 -->
    <router-view></router-view>
  </div>

  <!-- 底部组件 -->
  <AppFooter></AppFooter>
</template>

<script>
import AppNavbar from '@/components/header/AppNavbar'
import AppHeader from '@/components/header/AppHeader'
import AppFooter from '@/components/AppFooter'
import AppHeaderSticky from '@/components/header/AppHeaderSticky'
import { useStore } from 'vuex'
import { provide, reactive } from 'vue'

export default {
  name: 'Layout',
  components: {
    AppNavbar,
    AppHeader,
    AppFooter,
    AppHeaderSticky,
  },
  setup() {
    const store = useStore()
    // 获取下分类数据
    store.dispatch('category/getList')

    const orderObj = reactive({
      orderId: 0
    })

    provide('orderObj', orderObj)
    // getList()
    return {}
  }
}
</script>

<style lang="less" scoped>

</style>
